home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Explorer Yardimcilari / PiXCL Tools / Context.px_ / Context.px
Encoding:
PiXCL source  |  1996-06-14  |  4.5 KB  |  169 lines

  1. Initialize:
  2.     UseCoordinates(PIXEL)
  3.     Set WinTitle$ = "Test Context Sensitive Help"
  4.     WinGetActive(OldWin$)
  5.     WinTitle(OldWin$,WinTitle$)
  6.     WinLocate(WinTitle$,100,100,600,250,Res)
  7.     WinShow(WinTitle$,NOTOPMOST,Res)
  8.     DirGet(SourceDir$)
  9.     UseBackGround(TRANSPARENT,192,192,192)
  10.     DrawBackGround
  11.     Set Context$ = ""
  12.     InfoMenu(REMOVE)
  13.     WaitInput(100)
  14.     SetMenu("&File",IGNORE,
  15.         "E&xit!",Run_Leave,
  16.         ENDPOPUP,
  17.         "&HLP File",Get_Hlp_File,
  18.         ENDPOPUP,
  19.         "&Select Context",IGNORE,
  20.         "&CONTEXT ID",Get_Hlp_File_1,
  21.         "&TOPIC_name",Get_Hlp_File_2,
  22.         ENDPOPUP,
  23.         "&MAP file",View_MAP,
  24.         ENDPOPUP,
  25.         "&Help",IGNORE,
  26.         "&Concept",Concept,
  27.         SEPARATOR,
  28.         "&About",About,
  29.         ENDPOPUP)
  30.  
  31. Wait_for_Input:
  32.     WaitInput()
  33.  
  34. Run_Leave:
  35.     End
  36.  
  37. Get_Hlp_File:
  38.     DrawBackGround
  39.     Set Filter$ = "Help Files(*.hlp),*.hlp"
  40.     Set Caption$ = "Select the Help file to run"
  41.     Set InitDir$ = SourceDir$
  42.     Set InitFile$ = "*.hlp"
  43.     Set HLPfile$ = ""
  44.     FileGet(Filter$,InitFile$,InitDir$,Caption$,CHANGEDIR,HLPfile$)
  45.     If HLPfile$ = "" Then Goto Wait_for_Input
  46.     Set Select$ = "Selected File  " + HLPfile$
  47.     UseFont("Arial",9,21,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  48.     DrawText(11,11,Select$)
  49.     UseFont("Arial",9,21,NOBOLD,NOITALIC,NOUNDERLINE,255,255,0)
  50.     DrawText(10,10,Select$)
  51.     Goto Wait_for_Input
  52.  
  53.  
  54.  
  55. Get_Hlp_File_1:
  56.     If HLPfile$ <> "" Then Goto Get_Hlp_File_1a
  57.         MessageBox(OK,1,EXCLAMATION,"Please select a Helpfile.",
  58.         "No HLP file has been selected",Res)
  59.         Goto Wait_for_Input
  60.     {endif}
  61.  
  62. Get_Hlp_File_1a:
  63.     Set Label$ = "WinHelp CONTEXT"
  64.     Set Text$ = "Help file: " + HLPfile$
  65.     Set Text$ = Text$ + "
  66.  
  67. Enter the context ID integer. If you don't know
  68. what this is, see the help <project>.hh file."
  69.     TextBox(Text$,Label$,Context$,Btn)
  70.     If Btn = 2 Then Goto Wait_for_Input
  71.  
  72.     If Context$ <> "" Then Goto Get_Hlp_File_1b
  73.     MessageBox(OK,1,EXCLAMATION,"Please enter a Context ID.",
  74.     "No Context ID selected.",Res)
  75.     Goto Get_Hlp_File_1a
  76.     
  77. Get_Hlp_File_1b:
  78.     Set CommandLine$ = "winhlp32 -n " + Context$
  79.     Set CommandLine$ = CommandLine$ + " "
  80.     Set CommandLine$ = CommandLine$ + HLPfile$
  81.     Run(CommandLine$)
  82.     Goto Wait_for_Input
  83.  
  84. Get_Hlp_File_2:
  85.     If HLPfile$ <> "" Then Goto Get_Hlp_File_2a
  86.         MessageBox(OK,1,EXCLAMATION,"Please select a Helpfile.",
  87.         "No HLP file has been selected",Res)
  88.         Goto Wait_for_Input
  89.     {endif}
  90.  
  91. Get_Hlp_File_2a:
  92.     Set Label$ = "WinHelp CONTEXT"
  93.     Set Text$ = "Help file: " + HLPfile$
  94.     Set Text$ = Text$ + "
  95.  
  96. Enter the exact TOPIC_NAME, using '_' between words.
  97. If you don't know what this is, see the ROBOHELP 
  98. <project>.hh file."
  99.     TextBox(Text$,Label$,Context$,Btn)
  100.     If Btn = 2 Then Goto Wait_for_Input
  101.  
  102.     If Context$ <> "" Then Goto Get_Hlp_File_2b
  103.     MessageBox(OK,1,EXCLAMATION,"Please enter a TOPIC_NAME.",
  104.     "No TOPIC_NAME selected.",Res)
  105.     Goto Get_Hlp_File_2a
  106.     
  107. Get_Hlp_File_2b:
  108.     Set CommandLine$ = "winhlp32 -i " + Context$
  109.     Set CommandLine$ = CommandLine$ + " "
  110.     Set CommandLine$ = CommandLine$ + HLPfile$
  111.     Run(CommandLine$)
  112.     Goto Wait_for_Input
  113.  
  114.  
  115. View_MAP:
  116.     Set Filter$ = "MAP Files(*.hh),*.hh"
  117.     Set Caption$ = "Select the ROBOHELP(tm) map file"
  118.     Set InitDir$ = SourceDir$
  119.     Set InitFile$ = "*.hh"
  120.     Set HLPfile$ = ""
  121.     FileGet(Filter$,InitFile$,InitDir$,Caption$,CHANGEDIR,MAPfile$)
  122.     If MAPfile$ = "" Then Goto Wait_for_Input
  123.     Set CommandLine$ = "notepad " + MAPfile$
  124.     Run(CommandLine$)
  125.     Goto Wait_for_Input
  126.  
  127. Concept:
  128.     MessageBox(OK,1,INFORMATION,
  129. "This utility is used to test the links to context
  130. sensitive help topics in HLP files. You are asked
  131. for a HLP file, and then a context ID number or the
  132. actual topic. If a HLP file has not been defined, 
  133. you cannot enter an ID number. Once you have selected
  134. an HLP file, you can select any context ID number or
  135. topic.
  136.  
  137. You can also invoke NotePad to view ROBOHELP (tm)
  138. generated <project>.hh files.This is the list 
  139. of '#define <context_id> <integer>' entries 
  140. needed for the Windows application developer.
  141.  
  142. If an ID number is entered, WINHELP is invoked
  143. by the command line
  144.  
  145.     'winhlp32 -n <integer> <project>.hlp'
  146.  
  147. or if a topic_name is entered, using
  148.  
  149.     'winhlp32 -i <topic_name> <project>.hlp'
  150.  
  151. If WINHELP cannot locate the context ID or topic, 
  152. you will be prompted with a warning message that
  153. the 'Topic does not exist'.",
  154.     "Context Sensitive Help",Res)
  155.     Goto Wait_for_Input
  156.  
  157. About:
  158.     AboutUser("About Context","Context Sensitive Help Test Program.", 
  159. "Copyright ⌐ (1995-96) VYSOR Integration Inc.
  160. Gatineau, Quebec, CANADA. All Rights Reserved.")
  161.     Goto Wait_for_Input
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.         
  169.